-- grid_trans_to_monster
-- Create by chendh Dec/24/2016
-- 技能: 将格子变身成怪物
-- 参数列说明：
-- 空

return {
    apply = function(source, target, skillId, round, para, extra)
        for pos=1, GRID_SIZE do
            local grid = DungeonM.getGridByPos(pos);
            local element = grid.element;
            local elemDbase = DungeonM.queryElement(element, "dbase") or {};
            local toElement = elemDbase.trans_element;

            if toElement then
                local toClass = DungeonM.queryElement(toElement, "class");
                local para = { ["class"] = toClass, ["element"] = toElement };

                DungeonM.transformGrid(toClass, pos, GRID_STATE_OPEN, para);

                -- 抛出事件
                EventMgr.fire(event.GRID_TRANS_TO_MONSTER, {["source"] = source, ["skill_id"] = skillId });
            end
        end
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return {};
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        return desc;
    end,
}

